package com.roy.hanlpDemo;

import java.util.List;

import com.hankcs.hanlp.HanLP;
import com.hankcs.hanlp.seg.Segment;
import com.hankcs.hanlp.seg.CRF.CRFSegment;
import com.hankcs.hanlp.seg.common.Term;
import com.hankcs.hanlp.tokenizer.IndexTokenizer;
import com.hankcs.hanlp.tokenizer.NLPTokenizer;
import com.hankcs.hanlp.tokenizer.SpeedTokenizer;

public class HanLPDemo {
	//http://hanlp.linrunsoft.com/
	public static void main(String[] args) {
		String message = "你好，欢迎使用HanLP汉语处理包！随便意思意思。";
		System.out.println("标准分词 > "+HanLP.segment(message));
		
		System.out.println("NLP分词 > "+NLPTokenizer.segment(message));
		
		System.out.println("索引分词 > "+IndexTokenizer.segment(message));
		System.out.println("极速字典分词 > "+SpeedTokenizer.segment(message));
		
		Segment segment = new CRFSegment();
		segment.enablePartOfSpeechTagging(true);
		List<Term> termList = segment.seg(message);
		System.out.println("CRF分词 > "+termList);
	}
}
